###
 # @Company: TWL
 # @Author: xue jian
 # @Email: xuejian@kanzhun.com
 # @Date: 2020-05-07 15:10:46
 ###
#!/bin/bash

date=$1
day=`date -d "$date" +%Y%m%d`

outpath=/data2/training_data/ffm_recall/${date}
if [ ! -d $outpath ]; then
    mkdir -p ${outpath}
fi

hive -e "select boss_id, job_id, boss_position, job_degree, jh, jl, job_workyears, boss_cmp_level, geek_id, geek_position, geek_degree, geek_school_level, eh, el, geek_cmp_level, exp_min_active_tdiff, geek_workyears, deal_type, list_time, pmod(datediff('${date}', '1920-01-01') - 3, 7) as day_of_week, exp_id, geek_city, boss_l2code, boss_l1code, boss_addf_geek_recent10, boss_addf_expect_recent10, job_addf_geek_recent10, job_addf_expect_recent10 from arc_six_dev.bossrec_train_exposure where ds = '$date' order by list_time limit 200000000;" > ${outpath}/out

chmod -R 777 ${outpath}

cd /data1/arc_six/transfer
cat ${outpath}/out | ./transfer_flash /data2/training_data/recall_fid_data/${date} >> /data1/arc_six/transfer/result
